import React from 'react';
import { ts2Formatter,renderState,renderEnable } from 'utils';
import { actions } from 'mirrorx';
{/*
可配置化种类：

1、表格头部字段 
    1、列表页表格头部字段集合 mainTableColumn
    2、编辑页表格头部字段集合 childTableColumn

2、编辑框的字段
    1、编辑页 直接显示在页面的编辑字段 FormField
    2、编辑页 需要点击表格的增行弹框编辑的字段 FormTableField
    3. 列表页查询区域  searchField

3.表头部的按钮  headerButtonSets

4.表行尾部按钮  columnButtonSets
*/}

//表头信息

//字段属性

//基本信息
const FormDataHeader = [
    {
        enname: "billCode",
        zhname: "单据号",
        edit: false,
        hidepage:{0:true},
        type: "FormControl",
    },
    // {
    //     enname: "billTypeFeeId",
    //     codename: "billTypeFeeCode",
    //     showname: "billTypeFeeName",
    //     zhname: "单据类型",
    //     edit: true,
    //     code:"BILL_TYPE_FEE",
    //     type: "Select",
    // },
    {
        enname: "saleStatisticBasisId",
        codename: "saleStatisticBasisCode",
        showname: "saleStatisticBasisName",
        zhname: "销量统计依据",
        code: "SALE_STATISTIC_BASIS",
        type: "Select",
        edit: true,
        requirecontrol: [{
            value: "02",
            refKey: "code",
            dtoKey: "saleStatisticBasisCode",
            layer: ["childTableColumn", "expenseSummarySummaries", "column"],
            fields: ["customerName"]
        }],
        hidepage:{0:true},
        required: false,
    },
    {
        enname: "billStatusId",
        codename: "billStatusCode",
        showname: "billStatusName",
        zhname: "审批状态",
        type: "Select",
        hidepage: { 0: true },
        code: "BILL_STATUS",
        required: false,
        edit: false,
    },
    {
        enname: "isEnable",
        zhname: "启用状态",
        type: "Radio",
        hidepage: { 0: true },
        options: [{
            "key": 1,
            "value": "已启用"
        }, {
            "key": 2,
            "value": "停用"
        }],
        edit: false,
    },
    {
        enname: "organizationId",
        codename: "organizationCode",
        showname: "organizationName",
        zhname: "所属组织",
        type: "RefComponent",
        param:{
            "AUTH_refdim": "organization", 
            "AUTH_refcod": "ExpenseSummary"
        },
        cascadeName:[{
            paramkey: "EQ_organization.id",
            childtype: "DataHeader",
            refKey: "refpk",
            dtoKey: "organizationId",
            offers: "reportAreaId",
            resetOffersFlag: true,
        },
        {
            paramkey: "EQ_organization",
            childtype: "DataHeader",
            refKey: "refpk",
            dtoKey: "organizationId",
            offers: "approvalId",
            resetOffersFlag: true,
        }
        ],
        cascadeChildTable:[{
            refKey: "refpk", 
            dtoKey: "organizationId",
            childType:"expenseSummaryDetails" 
        }],
        refname:"organization",
        edit: true,
    },
    {
        enname: "approvalId",
        codename: "approvalCode",
        showname: "approvalName",
        zhname: "审批管理",
        refname: "approvalDocZJSP001",
        alias:"organizationId",
        type: "RefComponent",
        edit: true,
        required: true,
    },
    {
        enname: "reportPersonId",
        codename: "reportPersonCode",
        showname: "reportPersonName",
        zhname: "起案人",
        type: "RefComponent",
        param:{
            "AUTH_refdim": "reportPerson", 
            "AUTH_refcod": "ExpenseSummary"
        },
        hidepage:{0:true},
        refname:"personRef",
        edit: true,
    }, 
    
    {
        enname: "reportAreaId",
        codename: "reportAreaCode",
        showname: "reportAreaName",
        zhname: "起案片区",
        edit: true,
        param:{
            "AUTH_refdim": "reportArea", 
            "AUTH_refcod": "ExpenseSummary"
        },
        alias:"organizationId",
        type: "RefComponent",
        refname:"departmentRef",
        required: false,
    },
    // {
    //     enname: "activityName",
    //     zhname: "标题",
    //     edit: true,
    //     type: "FormControl",
    //     pattern:/^\S*$/,
    //     message: "不能有空格",
    //     required: false,
    // },
    // {
    //     enname: "activitySchemeId",
    //     zhname: "决裁申请单号",
    //     edit: false,
    //     type: "FormControl",
    //     required: false,
    // },
    {
        enname: "actualCostAmount",
        zhname: "实际报销总额",
        edit: false,
        type: "InputNumber",
        precision:2,
        required: false,
    },
    {
        enname: "actualCostAmount1",
        zhname: "实际费用总额",
        edit: false,
        type: "InputNumber",
        precision:2,
        required: false,
    },
    {
        enname: "activityName",
        zhname: "标题",
        edit: false,
        type: "FormControl",
        precision:2,
        required: false,
    },
    {
        enname: "creationTime",
        zhname: "制单日期",
        hidepage:{0:true},
        edit: false,
        format:"YYYY-MM-DD",
        type: "DatePicker",
    },
    {
        enname: "ext06",
        zhname: "更新时间",
        type: "FormControl",
        required: false,
        hidepage: { 0:true,1:true},
        edit: false,
    },
];
const columnexpenseSummaryDetails = [
    {
        dataIndex: "ext02",
        key:"ext02",
        title: "决裁申请单号",
        width:150,
        required: false,
        render:(text,record) => {
            return <a 
                value="ActivityScheme" 
                name="决裁申请单"
                onClick = {(e)=>{
                    e.preventDefault();//阻止默认事件
                    window.top.handleClick(e,1);//调用打开新页签方法
                    
                }}
                href={encodeURIComponent(encodeURIComponent(`/fmcg-web-react/OrderFish#/ActivityProgram-edit?search_id=${record.ext03}&btnPageFlag=${2}`))} >
                {text}
            </a>
        }
    },
    // {
    //     title: "行号",
    //     dataIndex: "rowNum",
    //     width: 80,
    //     key:"rowNum",
    // },
    {
        title: "活动开始日期",
        dataIndex: "activityStartDate",
        key:"activityStartDate",
        renderType: "datepicker",
        width: 120,
        required:true,
        render: (text, record, index) => {
            return text && ts2Formatter(text);
        },
        filedProps: {
            format:"YYYY-MM-DD",
        }
    },
    {
        title: "活动结束日期",
        dataIndex: "activityEndDate",
        key:"activityEndDate",
        renderType: "datepicker",
        width: 120,
        required:true,
        render: (text, record, index) => {
            return text && ts2Formatter(text);
        },
        filedProps: {
            format:"YYYY-MM-DD",
        }
    },
    {
        title: "客户名称",
        dataIndex: "customerName",
        key: "customerId",
        renderType: "refcomponent",
        width: 150,
        validate: false,
        required:true,
        filedProps: {
            childType: "retailOrderItems",
            title: "客户名称",
            constparam:{
                "AUTH_refdim": "customer", 
                "AUTH_refcod": "ExpenseSummary",
                "EQ_isFrozen": "0"
            },
            aliasparam: [{
                paramkey: "EQ_customerAreas.organization.id",
                alias: "organizationId",
            }],
            offersparam: {
                currentkey: ["custChanTypeId","custChanTypeName","custChanTypeCode"],
                offerfields: ["channelTypeId","channelTypeName","channelTypeCode"],
            },
            refName: "terminalcustomerRef",
            fieldName: "customerName",
            reffields: { refpk: "customerId", refname: "customerName", refcode: "customerCode" }
        },
    },
    {
        title: "渠道",
        dataIndex: "channelTypeName",
        key: "channelTypeId",
        renderType: "refcomponent",
        width: 150,
        validate: false,
        required:true,
        filedProps: {
            childType: "retailOrderItems",
            title: "渠道",
            constparam:{
                "AUTH_refdim": "channelType", 
                "AUTH_refcod": "ExpenseSummary"
            },
            refName: "custchantype",
            fieldName: "channelTypeName",
            reffields: { refpk: "channelTypeId", refname: "channelTypeName", refcode: "channelTypeCode" }
        },
    },
    {
        title: "销售类型",
        dataIndex: "saleTypeCode",
        key: "saleTypeCode",
        renderType: "select",
        width:100,
        filedProps: {
            reffields: { refpk: "saleTypeId", refname: "saleTypeName", refcode: "saleTypeCode" },
            options: [
                {
                    name: '正常机', code: "01", id: "0CHGSH6gs1gdv6I87ML9"
                },
                {
                    name: '特价机', code: "02", id: "0OSFSXyPTvenR3RDbpy5"
                },
            ]
        },
        edit: true,
        required: false,
    },
    {
        dataIndex: "actualSaleNum",
        key: "actualSaleNum",
        title: "实际销售台量",
        // renderType: "inputnumber",
        width:110,                  
        // filedProps: {
        //     precision:2,
        //     except:0,
        //     min: 0,
        // },
        // edit: true,
        // required: false,
    },
    {
        dataIndex: "actualSaleAmount",
        key: "actualSaleAmount",
        title: "实际销售额",
        // renderType: "inputnumber",
        width:110,
        // filedProps: {
        //     precision:2,
        //     except:0,
        //     min: 0,
        // },
        // edit: true,
        // required: false,
    },
    {
        dataIndex: "actualCostAmount",
        key: "actualCostAmount",
        title: "实际报销额",
        renderType: "inputnumber",
        edit: true,
        width:110,
        filedProps: {
            precision:2,
            except:0,
            min: 0,
        },
        required: true,
    },{
        dataIndex: "actualCostAmount1",
        key: "actualCostAmount1",
        title: "实际费用额",
        renderType: "inputnumber",
        edit: true,
        width:110,
        filedProps: {
            precision:2,
            except:0,
            min: 0,
        },
        required: true,
    },{
        dataIndex: "actualCostRate",
        key: "actualCostRate",
        title: "实际费用率%",
        // renderType: "inputnumber",
        edit: true,
        width:110,
        filedProps: {
            precision:2,
            // except:0,
            min: 0,
        },
        required: false,
    },{
        dataIndex: "saleCompletionRate",
        key:"saleCompletionRate",
        title: "销售完成率",
        renderType: "inputnumber",
        edit: true,
        width:110,
        filedProps: {
            precision:2,
            // except:0,
            min: 0,
        },
        required: false,
    },{
        dataIndex: "theoreticalReimburseAmount",
        key:"theoreticalReimburseAmount",
        title: "预算报销额",
        width:110,
    },{
        dataIndex: "theoreticalCostAmount",
        key:"theoreticalCostAmount",
        title: "预算费用额",
        width:110,
    },{
        dataIndex: "ext04",
        key:"ext04",
        title: "公司单台费用合计(零售)",
        width:110,
    },{
        dataIndex: "occurMonth",
        key:"occurMonth",
        title: "发生月份",
        renderType: "datepicker",
        filedProps: {
            format:"YYYY-MM",
            formatType:"month"
        },
        required: false,
    },{
        dataIndex: "brief",
        key:"brief",
        title: "备注",
        renderType: "input",
        pattern:/^\S*$/,
        patternMessage: "不能有空格",
        filedProps: {
            maxLenght:200,
        },
        required: false,
    }
]

const columnexpenseSummaryBudgets = [
    {
        title: "预算方案",
        dataIndex: "budgetPlanCode",
        key: "budgetPlanCode",
        detailwidth: 120,
        render:(text,record) => {
            return <a 
                value="BudgetPlan" 
                name="预算方案"
                onClick = {(e)=>{
                    e.preventDefault();//阻止默认事件
                    window.top.handleClick(e,1);//调用打开新页签方法
                }}
                href={encodeURIComponent(encodeURIComponent(`/fmcg-web-react/OrderFish#/BudgetPlan-edit?search_id=${record.budgetPlanId}&btnPageFlag=${2}`))} >
                {text}
            </a> 
        }
    },    
    {
        title: "预算优先级",
        dataIndex: "budgetPriority",
        key: "budgetPriority",
        detailwidth: 80,
    },
    {
        title: "公司",
        dataIndex: "saleOrgName",
        key: "saleOrgName",
        detailwidth: 80,
    },
    {
        title: "部门",
        dataIndex: "departmentName",
        key: "departmentName",
        detailwidth: 70,
    },
    {
        title: "客户",
        dataIndex: "customerName",
        key: "customerName",
        detailwidth: 150,
    },
    {
        title: "渠道",
        dataIndex: "channelName",
        key: "channelName",
        detailwidth: 50,
    },
    {
        title: "门店",
        dataIndex: "terminalStoreName",
        key: "terminalStoreName",
        detailwidth: 150,
    },
    {
        title: "预算总额",
        dataIndex: "budgetAmount",
        key: "budgetAmount",
        detailwidth: 70,
    },
    {
        title: "预算余额",
        dataIndex: "surplusAmount",
        key: "surplusAmount",
        detailwidth: 70,
    },
    {
        title: "剩余预算余额",
        dataIndex: "budgetBalance",
        key: "budgetBalance",
        detailwidth: 80,
    },
    {
        title: "预算费用率",
        dataIndex: "budgetRate",
        key: "budgetRate",
        detailwidth: 70,
    },
    {
        title: "超预算率",
        dataIndex: "overBudgetRate",
        key: "overBudgetRate",
        detailwidth: 50,
    },
]

const columexpenseSummarySummaries = [
    {
        title: "客户",
        dataIndex: "customerName",
        key: "customerId",
        renderType: "refcomponent",
        width: 250,
        // validate: false,
        // required: true,
        hideFlag:true,
        filedProps: {
            title: "客户",
            refName: "terminalcustomerRef",
            constparam:{
                "AUTH_refdim": "customer", 
                "AUTH_refcod": "ActivityScheme"
            },
            aliasparam: [{
                paramkey: "EQ_customerAreas.organization.id",
                alias: "organizationId",
            }],
            offersparam: {
                currentkey: ["custChanTypeId","custChanTypeName","custChanTypeCode"],
                offerfields: ["channelTypeId","channelTypeName","channelTypeCode"],
            },
            fieldName: "customerName",
            reffields: { refpk: "customerId", refname: "customerName", refcode: "customerCode" }
        },
    },
    {
        title: "渠道",
        dataIndex: "channelTypeName",
        key: "channelTypeId",
        renderType: "refcomponent",
        width: 150,
        validate: false,
        required: true,
        filedProps: {
            title: "渠道",
            refName: "custchantype",
            constparam:{
                "AUTH_refdim": "custchantype", 
                "AUTH_refcod": "ActivityProgram"
            },
            fieldName: "channelTypeName",
            reffields: { refpk: "channelTypeId", refname: "channelTypeName", refcode: "channelTypeCode" }
        },
    },
    // {
    //     title: "商品型号",
    //     dataIndex: "goodsName",
    //     key: "goodsId",
    //     renderType: "refcomponent",
    //     width: 150,
    //     validate: false,
    //     required: true,
    //     filedProps: {
    //         title: "商品型号",
    //         refName: "goodsRef",
    //         fieldName: "goodsName",
    //         reffields: { refpk: "goodsId", refname: "goodsName", refcode: "goodsCode" }
    //     },
    // },
    // {
    //     title: "单价(元/台)",
    //     dataIndex: "unitPrice",
    //     key: "unitPrice",
    //     renderType: "inputnumber",
    //     width:110,
    //     filedProps: {
    //         precision: 2,
    //         except:0,
    //         min: 0,
    //     }
    // },
    {
        title: "实际销售台量-系统",
        dataIndex: "actualSaleNum",
        key: "actualSaleNum",
        renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "实际销售额-系统",
        dataIndex: "actualSaleAmount",
        key: "actualSaleAmount",
        renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "折让-单台(元/台）",
        dataIndex: "discountSingle",
        key: "discountSingle",
        renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "折让-单台追加(元/台）",
        dataIndex: "discountSingleAppend",
        key: "discountSingleAppend",
        renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "折让-销售费用%",
        dataIndex: "discountSaleCost",
        key: "discountSaleCost",
        renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
            max:100
        }
    },
    {
        title: "折让-预留费用%",
        dataIndex: "discountReserveCost",
        key: "discountReserveCost",
        renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
            max:100
        }
    },

    {
        title: "折让-小计(元）",
        dataIndex: "discountTotal",
        key: "discountTotal",
        // renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "薪资-带单(元/台）",
        dataIndex: "salaryWithOrder",
        key: "salaryWithOrder",
        renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "薪资-变动提成(元/台）",
        dataIndex: "salaryTransferCommission",
        key: "salaryTransferCommission",
        renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "薪资-销售激励%",
        dataIndex: "salarySaleInspire",
        key: "salarySaleInspire",
        renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
            max:100
        }
    },
    {
        title: "薪资-小计（元）",
        dataIndex: "salaryTotal",
        key: "salaryTotal",
        // renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "电汇-单台激励",
        dataIndex: "wireSingleInspire",
        key: "wireSingleInspire",
        renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "电汇-销售激励%",
        dataIndex: "wireSaleInspire",
        key: "wireSaleInspire",
        renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
            max:100
        }
    },
    {
        title: "电汇-小计(元）",
        dataIndex: "wireTransfer",
        key: "wireTransfer",
        // renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "实际报销额合计",
        dataIndex: "actualCostAmountTotal",
        key: "actualCostAmountTotal",
        // renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "实际费用率%",
        dataIndex: "actualCostRate",
        key: "actualCostRate",
        // renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "实际报销额合计(元)",
        dataIndex: "actualReimburseAmount",
        key: "actualReimburseAmount",
        // renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "实际销售台量-模板",
        dataIndex: "actualSaleNumTpl",
        key: "actualSaleNumTpl",
        renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    },
    {
        title: "实际销售额-模板",
        dataIndex: "actualSaleAmountTpl",
        key: "actualSaleAmountTpl",
        renderType: "inputnumber",
        width:110,
        filedProps: {
            precision: 2,
            except:0,
            min: 0,
        }
    }
]
//表单字段

export const FormField = {
    "DataHeader": {
        "title": "基础信息",
        "Field": FormDataHeader
    },
}

//表格弹框表单字段
export const FormTableField = {
}


const columnexpenseSummaryAttachments = [
    {
        title: "标题",
        dataIndex: "filename",
        key: "filename",
        detailwidth: 250,
    }, {
        title: "上传时间",
        dataIndex: "creationTime",
        key: "creationTime",
        detailwidth: 150,
        render: (text, record, index) => {
            return text && ts2Formatter(text,1);
        }
    }, {
        title: "缩略图",
        dataIndex: "fileUrl",
        key: "fileUrl",
        width: 150,
        render: (text, record, index) => {
            if(record.fileUrl.search("jpg") != -1 || record.fileUrl.search("jpeg") != -1 ||record.fileUrl.search("png") != -1){
                return <span>
                <img style={{"width":"35px"}} src={text} />
             </span>
            }else {
                return ""
            }
            
        }
    }, 
    {
        title: "创建人",
        dataIndex: "creator",
        key: "creator",
        width: 150,
    }
]
//渲染成字表表格的头
export const childTableColumn = {
    "expenseSummaryDetails": {
        "title": "明细",
        "type": "grid",
        "column": columnexpenseSummaryDetails
    },
    "expenseSummaryBudgets": {
        "title": "预算明细",
        "type": "grid",
        "column": columnexpenseSummaryBudgets
    },
    "expenseSummarySummaries": {
        "title": "活动总结",
        "type": "grid",
        "column": columexpenseSummarySummaries
    },
    "expenseSummaryAttachments": {
        "title": "附件",
        "type": "grid",
        "column": columnexpenseSummaryAttachments
    }
}

//渲染成字表表格的头
export const mainTableColumn = [
    {
        title: "单据号",
        dataIndex: "billCode",
        width: 120,
        key: "billCode",
        render: (text, record) => {
            return <a style={{ "cursor": "pointer" }}
                onClick={() => {
                    actions.routing.push(
                        {
                            pathname: 'ExpenseSum-edit',
                            search: `?search_id=${record.id}&btnPageFlag=2`,
                        }
                    );
                    // location.reload();
                }}
            >
                {text}
            </a >;
        }
    },
    // {
    //     title: "单据类型",
    //     dataIndex: "billTypeFeeName",
    //     width: 100,
    //     key: "billTypeFeeName",
    // },
    {
        title: "审批状态",
        dataIndex: "state",
        key: "state",
        width: 100,
        render:(text, record, index)=> {
            return renderState(text);
        }
    },
    {
        title: "启用状态",
        dataIndex: "isEnable",
        width:90,
        key: "isEnable",
        render: (text) => {
            return renderEnable(text);
        }
    },
    {
        title: "所属组织",
        dataIndex: "organizationName",
        key: "organizationName",
    },
    {
        title: "起案人",
        dataIndex: "reportPersonName",
        key: "reportPersonId",
    },
    {
        title: "标题",
        dataIndex: "activityName",
        key: "activityName",
    },
    {
        title: "起案片区",
        dataIndex: "reportAreaName",
        width: 110,
        key: "reportAreaName",
    },
    {
        title: "审批管理",
        dataIndex: "approvalName",
        width: 100,
        key: "approvalName",
    },
    {
        title: "制单日期",
        dataIndex: "creationTime",
        width: 110,
        key: "creationTime",
        render: (text) => {
            return text && ts2Formatter(text)
        }
    },
    // {
    //     title: "标题",
    //     dataIndex: "activityName",
    //     width: 120,
    //     key: "activityName",
    // },
    // {
    //     title: "决裁申请单号",
    //     dataIndex: "activitySchemeBillCode",
    //     width: 120,
    //     key: "activitySchemeBillCode",
    // },
    // {
    //     title: "费用确认单据号",
    //     dataIndex: "expenseConfirmId",
    //     width: 120,
    //     key: "expenseConfirmId",
    // }
]
export const searchField = [
    {
        enname: "creationTime",
        zhname: "制单日期",
        required: false,
        type: "RangePicker",
        rangeField: ["creationTime", "creationTime"],
        edit: true
    },
    {
        enname: "billCode",
        zhname: "单据号",
        required: false,
        type: "FormControl",
        searchType:"like",
        edit: true
    },
    {
        enname: "organization",
        zhname: "所属组织",
        required: false,
        refname:"organization",
        realRef:true,
        param:{
            "AUTH_refdim": "organization", 
            "AUTH_refcod": "ExpenseSummary"
        },
        type: "RefComponent",
        edit: true
    },
    {
        enname: "reportPerson",
        zhname: "起案人",
        type: "RefComponent",
        refname: "personRef",
        realRef:true,
        edit: false,
    },
    {
        enname: "reportArea",
        zhname: "起案片区",
        type: "RefComponent",
        refname: "departmentRef",
        realRef:true,
        edit: false,
    },
    {
        enname: "activityName",
        zhname: "标题",
        required: false,
        type: "FormControl",
        searchType:"like",
        edit: true
    },
    {
        enname: "expenseSummaryDetails&ext02",
        zhname: "决裁申请单号",
        required: false,
        type: "FormControl",
        searchType:"like",
        edit: true
    },
    {
        enname: "saleStatisticBasis",
        zhname: "销量统计依据",
        required: false,
        code: "SALE_STATISTIC_BASIS",
        type: "Select",
        edit: true,
    },
    {
        enname: "ext03",
        zhname: "决裁名称",
        refname: "defdoc",
        type: "RefComponent",
        realRef:true,
        multiple:true,
        edit: true,
    },
    {
        enname:"state",
        zhname:"审批状态",
        required: false,
        code:"BILL_STATUS",
        type: "Select",
        edit: true
    },
    {
        enname:"isEnable",
        zhname:"启用状态",
        required: false,
        options: [{
            "key": 1,
            "value": "已启用"
        }, {
            "key": 2,
            "value": "停用"
        }],
        type: "Radio",
        edit: true
    },
]

export const headerButtonSets = [
    // {
    //     event: "ButtonAdd",
    //     zhname: "新增",
    //     color: 'primary',
    //     authcode: "9901-05-02-01",
    // }
    {
        event: "ButtonEnable",
        zhname: "启用",
        authcode: "Summarystart",
        method: "post",
        batch:true,
        ContentType: 'application/x-www-form-urlencoded;charset=utf-8',
        url: 'occ-fee/fee/expense-summary/enable'
    },
    {
        event: "ButtonEnable",
        zhname: "停用",
        authcode: "Summarystop",
        method: "post",
        batch:true,
        ContentType: 'application/x-www-form-urlencoded;charset=utf-8',
        url: 'occ-fee/fee/expense-summary/disenable'
    }
]

export const columnButtonSets = {
    "delete": {
        event: "ButtonDel",
        zhname: "删除",
        batch: true,
        method: "post",
        ContentType: 'application/x-www-form-urlencoded;charset=utf-8',
        url: 'occ-fee/fee/expense-summary/deleteByIds'
    },
    "edit": true,
    "detail": true
}

// export default {mainTableColumn,searchField,headerButtonSets,
//     columnButtonSets,childTableColumn,FormTableField,FormField}
export const SelectCode = ["QY132","ls002","ls001","sale","FA001","BILL_STATUS","BILL_TYPE_FEE","SALE_STATISTIC_BASIS","QRSP001"]
